1. Technical Field
This invention in general relates to database management systems. More specifically, this invention relates to a cache-conscious concurrency control scheme for memory-resident index structures in database systems.
2. Description of the Related Art
As the price of server DRAM modules continues to drop, the main memory database management system (MM DBMS) emerges as an economically viable alternative to the disk-resident database management system (DR DBMS) in many applications. MM DBMS is potentially capable of orders-of-magnitude higher performance than DR DBMS not only for read transactions but also for update transactions.
However, such a significant performance gain of MM DBMS over DR DBMS does not come automatically, but requires MM DBMS-specific optimization techniques, especially the efficient use of cache. Cache, a special memory device whose access time is much faster than main memory, stores frequently referenced data items so as to improve the overall memory access performance. The effect of cache in MM DBMS is an important consideration in the design of main memory indexes and query processing.
There are so-called cache-conscious index structures, such as CSS-tree (Cache-Sensitve Search Tree) and CSB+-tree (Cache-Sensitive B+ Tree), that were proposed as alternative index structures that can reduce cache misses and thereby improve the search performance. The CSS-tree places the index nodes, level by level in an array, enabling the index traversal by computing the array offsets. The CSB+-tree keeps only one child pointer of B+-tree per node, almost doubling the fanout of the tree but at the expense of increasing the update cost.
There are other index structures such as the CR-tree, which efficiently compresses the MBR keys to pack more entries per node recognizing the pointer elimination is not effective for the R-tree whose MBR key is much bigger than a pointer. There are the pkT-tree and the pkB-tree that significantly reduce cache misses by storing partial-key information in the index in the face of nontrivial key sizes.
While all of these cache-conscious index structures employ some means of effectively increasing the index fanout and reducing the so-called cold and capacity cache misses, the design of the index structure did not take into account of concurrency control. Concurrency control is required to coordinate simultaneous execution of transactions in a multiprocessing environment having multiple users or multiple processors. Concurrency control is crucial to running real-world main memory database applications involving index updates as well as taking advantage of off-the-shelf multiprocessor platforms for scaling up the performance of such applications.
One approach to deal with this problem is to use a concurrency control scheme used in a conventional, disk-resident system, such as lock coupling. Lock coupling latches index nodes during index traversal. The index traversal proceeds from one node to its child by holding a latch on the parent while requesting a latch on the child. The requested latch is a shared mode if the child is not the target node. If the child is the target node, the requested latch may be a shared or exclusive mode, depending on the action to be performed on the target node. A shared lock is issued when a transaction wants to read data from a node. An exclusive lock is issued when a transaction wants to write a data item on a node. The latch on the parent node is released once the child node is latched. However, latching involves a memory write, which is subject to coherence cache misses in a multiprocessing environment.
There is a technique called physical versioning that allows index traversal without latching. The idea is to create a new version of an index node for the update so that the transactions reading existing index nodes would not interfere with those transactions updating index nodes. This enables latch-free traversal of indexes, achieving a high-level of concurrency for read transactions. Incorporation of the updated version into the index involves obtaining latches either at the tree-level or both on the tree and the node to update. The major problem with the physical versioning technique is a high cost of creating the versions. The index performance degrades sharply with increasing the update ratio. The scalability of update performance is very poor with respect to the number of multiple processing elements.
Therefore, there is a need for an efficient index structure and a concurrency control scheme that optimize database management systems against the high cost of cache invalidation in a multiprocessing environment.